<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <link rel="stylesheet" href="../bootstrap-3.3.7-dist/css/bootstrap.css" media="screen"/>
    <link rel="stylesheet" href="../css/login.css" media="screen" />
    <link rel="stylesheet" href="../bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css" media="screen"/>
    <script src="../jquery/jquery-3.3.1.min.js"></script>
    <script src="../bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script src="../bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js"></script>
    <script src="../bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <title>home</title>
</head>

<body>
<header>
    <div class="header-top">
        <div class="container">
            <div class="row">
                <div class="header-top-left">
                    <div class="welcome-msg"><span>欢迎来到四川大学科技成果交易平台!</span></div>
                </div>
                <div class="header-top-right">
                    <ul class="header-links">
                        <li><a href="index.html">首页</a></li>
                        <li><a href="about.html">关于</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</header>

<div class="panel panel-default container">
    <div class="panel-heading row">
        个人信息
    </div>
    <div class="panel-body row">
        <div class="row">
            <form enctype="multipart/form-data" class="form-horizontal" role="form" action="/updateAvatar" method="post">
                <div class="col-sm-1 col-xs-1">
                    <label class="control-label">头像:</label>
                </div>
                <div class="col-sm-5 col-xs-5">
                    <input type="file" name="avatar" hidden="hidden"/>
                    <a th:href="${userVO.avatar}" class="thumbnail" style="width: 150px;height: 150px;">
                        <img th:if="${userVO}!=null" th:src="${userVO.avatar}" alt="avatar"/>
                    </a>
                </div>
                <div class="col-sm-3 col-xs-3">
                        <button type="submit" class="btn btn-default">修改头像</button>
                </div>
            </form>
        </div>
        <form action="/updateUser" method="post">
            <div class="row">
                <div class="col-sm-1 col-xs-1">
                    <label for="nickname" class=" control-label">昵称:</label>
                </div>
                <div class="col-sm-5 col-xs-5">
                    <div class="col-sm-10" th:if="${userVO}" >
                        <input type="text" class="form-control" id="nickname" name="nickname" placeholder="nickname"
                               th:value="${userVO.nickname}" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-1 col-xs-1">
                    <label for="sex1" class="control-label">性别:</label>
                </div>
                <div class="col-sm-5 col-xs-5">
                    <div th:if="${userVO}">
                        <label class="radio-inline" for="sex1">
                            <input type="radio" id="sex1" name="sex" value="male" th:checked="${userVO.sex}=='male'"/>男
                        </label>
                        <label class="radio-inline" for="sex2">
                            <input type="radio" id="sex2" name="sex" value="female" th:checked="${userVO.sex}=='female'"/>女
                        </label>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-1 col-xs-1">
                    <label  class="control-label">生日:</label>
                </div>
                <div class="col-sm-5 col-xs-5">
                    <div th:if="${userVO}" class="controls input-append date form_date col-sm-10" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
                        <input  class="form-control" th:if="${userVO.birthday}" type="text" th:value="${userVO.birthday}" name="birthday"/>
                        <input  class="form-control" th:if="!${userVO.birthday}" type="text" th:value="2000-1-1" name="birthday"/>
                        <span class="add-on"><i class="icon-remove"></i></span>
                        <span class="add-on"><i class="icon-th"></i></span>
                    </div>
                    <!--<input type="hidden" id="dtp_input2" value="" /><br/>-->
                </div>
            </div>
            <div class="row">
                <div class="col-sm-1 col-xs-1">
                    <label for="address" class="control-label">地址:</label>
                </div>
                <div class="col-sm-5 col-xs-5">
                    <div class="col-sm-10" th:if="${userVO}">
                        <input type="text" class="form-control" id="address" name="address" placeholder="address"
                               th:value="${userVO.address}" />
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-5 col-xs-5">
                    <button type="submit"  class="btn btn-primary">更改 </button>
                </div>
            </div>
        </form>
    </div>
</div>
<footer>
    <div class="footer-middle">
        <div class="container">
            <div class="row">
                版权所有：Copyright © 2018 WSN
            </div>
        </div>
    </div>
</footer>
<script>
    $('.form_date').datetimepicker({
        format:'yyyy-mm-dd',
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0
    });
</script>

</body>
</html>